<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Releaser</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Releaser' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="index.html">inblorb</a></li><li><a href="index.html#3">Chapter 3: Other Material</a></li><li><b>Releaser</b></li></ul></div>
<p class="purpose">To manage requests to release material other than a Blorb file.</p>

<ul class="toc"><li><a href="3-rls.html#SP1">&#167;1. Requests</a></li><li><a href="3-rls.html#SP3">&#167;3. Receiving requests</a></li><li><a href="3-rls.html#SP5">&#167;5. Any Last Requests</a></li><li><a href="3-rls.html#SP6">&#167;6. Carrying out requests</a></li><li><a href="3-rls.html#SP7">&#167;7. The Extras file for a website template</a></li><li><a href="3-rls.html#SP8">&#167;8. The Manifest file for an interpreter</a></li><li><a href="3-rls.html#SP11">&#167;11. Blorb relocation</a></li><li><a href="3-rls.html#SP12">&#167;12. Reporting the release</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. Requests.</b>If the previous chapter, which wrote blorb files, was the Lord High Executioner,
then this one is the Lord High Everything Else: it keeps track of requests
to write all kinds of interesting things which are not blorb files,
and then sees that they are carried out. The requests divide as follows:
</p>

<pre class="definitions code-font"><span class="definition-keyword">enum</span> <span class="constant-syntax">COPY_REQ</span><span class="plain-syntax"> </span><span class="identifier-syntax">from</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax"> </span><span class="comment-syntax"> a miscellaneous file</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">IFICTION_REQ</span><span class="plain-syntax"> </span><span class="comment-syntax"> the iFiction record of a project</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">RELEASE_FILE_REQ</span><span class="plain-syntax"> </span><span class="comment-syntax"> a template file</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">RELEASE_SOURCE_REQ</span><span class="plain-syntax"> </span><span class="comment-syntax"> the source text in HTML form</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">SOLUTION_REQ</span><span class="plain-syntax"> </span><span class="comment-syntax"> a solution file generated from the skein</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">SOURCE_REQ</span><span class="plain-syntax"> </span><span class="comment-syntax"> the source text of a project</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">WEBSITE_REQ</span><span class="plain-syntax"> </span><span class="comment-syntax"> a whole website</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">INTERPRETER_REQ</span><span class="plain-syntax"> </span><span class="comment-syntax"> an in-browser interpreter</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">BASE64_REQ</span><span class="plain-syntax"> </span><span class="comment-syntax"> a base64-encoded copy of a binary file</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">INSTRUCTION_REQ</span><span class="plain-syntax"> </span><span class="comment-syntax"> a release instruction copied to inblorb for reporting only</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">ALTERNATIVE_REQ</span><span class="plain-syntax"> </span><span class="comment-syntax"> an unused release instruction copied to inblorb for reporting only</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">website_requested</span><span class="plain-syntax"> = </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">; </span><span class="comment-syntax"> has a </span><span class="extract"><span class="extract-syntax">WEBSITE_REQ</span></span><span class="comment-syntax"> been made?</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>Each request produces an instance of:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">request</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">what_is_requested</span><span class="plain-syntax">; </span><span class="comment-syntax"> one of the </span><span class="extract"><span class="extract-syntax">*_REQ</span></span><span class="comment-syntax"> values above</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">details1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">details2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">details3</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">private</span><span class="plain-syntax">; </span><span class="comment-syntax"> is this request private, i.e., not to contribute to a website?</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">outcome_data</span><span class="plain-syntax">; </span><span class="comment-syntax"> e.g. number of bytes copied</span>
<span class="plain-syntax">    </span><span class="constant-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">request</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>The structure request is private to this section.</li></ul>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. Receiving requests.</b>These can have from 0 to 3 textual details attached:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="function-syntax">Requests::request_0</span><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">kind</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">privacy</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">request</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">what_is_requested</span><span class="plain-syntax"> = </span><span class="identifier-syntax">kind</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details1</span><span class="plain-syntax"> = </span><a href="../foundation/4-sm.html#SP2" class="function-link"><span class="function-syntax">Str::new</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details2</span><span class="plain-syntax"> = </span><a href="../foundation/4-sm.html#SP2" class="function-link"><span class="function-syntax">Str::new</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details3</span><span class="plain-syntax"> = </span><a href="../foundation/4-sm.html#SP2" class="function-link"><span class="function-syntax">Str::new</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">private</span><span class="plain-syntax"> = </span><span class="identifier-syntax">privacy</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">outcome_data</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">kind</span><span class="plain-syntax"> == </span><span class="constant-syntax">WEBSITE_REQ</span><span class="plain-syntax">) </span><span class="identifier-syntax">website_requested</span><span class="plain-syntax"> = </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">req</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="function-syntax">Requests::request_1</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Requests::request_1</span></span>:<br/>Blurb Parser - <a href="1-bp.html#SP7_2">&#167;7.2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">kind</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">text1</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">privacy</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax"> = </span><a href="3-rls.html#SP3" class="function-link"><span class="function-syntax">Requests::request_0</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">kind</span><span class="plain-syntax">, </span><span class="identifier-syntax">privacy</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/4-sm.html#SP17" class="function-link"><span class="function-syntax">Str::copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details1</span><span class="plain-syntax">, </span><span class="identifier-syntax">text1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">req</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="function-syntax">Requests::request_2</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">Requests::request_2</span></span>:<br/>Blurb Parser - <a href="1-bp.html#SP7_2">&#167;7.2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">kind</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">text1</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">text2</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">privacy</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax"> = </span><a href="3-rls.html#SP3" class="function-link"><span class="function-syntax">Requests::request_0</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">kind</span><span class="plain-syntax">, </span><span class="identifier-syntax">privacy</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/4-sm.html#SP17" class="function-link"><span class="function-syntax">Str::copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details1</span><span class="plain-syntax">, </span><span class="identifier-syntax">text1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/4-sm.html#SP17" class="function-link"><span class="function-syntax">Str::copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details2</span><span class="plain-syntax">, </span><span class="identifier-syntax">text2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">req</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="function-syntax">Requests::request_3</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">Requests::request_3</span></span>:<br/><a href="3-rls.html#SP4">&#167;4</a><br/>Blurb Parser - <a href="1-bp.html#SP7_2">&#167;7.2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">kind</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">text1</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">text2</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">text3</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">privacy</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax"> = </span><a href="3-rls.html#SP3" class="function-link"><span class="function-syntax">Requests::request_0</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">kind</span><span class="plain-syntax">, </span><span class="identifier-syntax">privacy</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/4-sm.html#SP17" class="function-link"><span class="function-syntax">Str::copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details1</span><span class="plain-syntax">, </span><span class="identifier-syntax">text1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/4-sm.html#SP17" class="function-link"><span class="function-syntax">Str::copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details2</span><span class="plain-syntax">, </span><span class="identifier-syntax">text2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/4-sm.html#SP17" class="function-link"><span class="function-syntax">Str::copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details3</span><span class="plain-syntax">, </span><span class="identifier-syntax">text3</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">req</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>A convenient abbreviation:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Requests::request_copy</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">Requests::request_copy</span></span>:<br/><a href="3-rls.html#SP5">&#167;5</a><br/>Links and Auxiliary Files - <a href="3-laaf.html#SP8">&#167;8</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">subfolder</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="3-rls.html#SP3" class="function-link"><span class="function-syntax">Requests::request_3</span></a><span class="plain-syntax">(</span><span class="constant-syntax">COPY_REQ</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="identifier-syntax">to</span><span class="plain-syntax">, </span><span class="identifier-syntax">subfolder</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. Any Last Requests.</b>Most of the requests are made as the parser reads commands from the blurb
script. At the end of that process, though, the following routine may add
further requests as consequences:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Requests::any_last_requests</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">Requests::any_last_requests</span></span>:<br/><a href="3-rls.html#SP6">&#167;6</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="3-laaf.html#SP8" class="function-link"><span class="function-syntax">Links::request_copy_of_auxiliaries</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">default_cover_used</span><span class="plain-syntax"> == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">BIGCOVER</span><span class="plain-syntax"> = </span><a href="3-plc.html#SP3" class="function-link"><span class="function-syntax">Placeholders::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"BIGCOVER"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-sm.html#SP8" class="function-link"><span class="function-syntax">Str::len</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">BIGCOVER</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">cover_is_in_JPEG_format</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><a href="3-rls.html#SP4" class="function-link"><span class="function-syntax">Requests::request_copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">BIGCOVER</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Cover.jpg"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"--"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">                </span><a href="3-rls.html#SP4" class="function-link"><span class="function-syntax">Requests::request_copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">BIGCOVER</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Cover.png"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"--"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">website_requested</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">SMALLCOVER</span><span class="plain-syntax"> = </span><a href="3-plc.html#SP3" class="function-link"><span class="function-syntax">Placeholders::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"SMALLCOVER"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-sm.html#SP8" class="function-link"><span class="function-syntax">Str::len</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">SMALLCOVER</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">cover_is_in_JPEG_format</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><a href="3-rls.html#SP4" class="function-link"><span class="function-syntax">Requests::request_copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">SMALLCOVER</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Small Cover.jpg"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"--"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">                    </span><a href="3-rls.html#SP4" class="function-link"><span class="function-syntax">Requests::request_copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">SMALLCOVER</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Small Cover.png"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"--"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. Carrying out requests.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Requests::create_requested_material</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">Requests::create_requested_material</span></span>:<br/>Main - <a href="1-mn.html#SP3">&#167;3</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">release_folder</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PRINT</span><span class="plain-syntax">(</span><span class="string-syntax">"! Release folder: &lt;%p&gt;\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">release_folder</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">blorb_file_size</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><a href="3-rls.html#SP11" class="function-link"><span class="function-syntax">Requests::declare_where_blorb_should_be_copied</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">release_folder</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-rls.html#SP5" class="function-link"><span class="function-syntax">Requests::any_last_requests</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">, </span><span class="reserved-syntax">request</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">what_is_requested</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">ALTERNATIVE_REQ:</span><span class="plain-syntax"> </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">BASE64_REQ:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP6_5" class="named-paragraph-link"><span class="named-paragraph">Copy a base64-encoded file across</span><span class="named-paragraph-number">6.5</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">COPY_REQ:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP6_4" class="named-paragraph-link"><span class="named-paragraph">Copy a file into the release folder</span><span class="named-paragraph-number">6.4</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">IFICTION_REQ:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP6_3" class="named-paragraph-link"><span class="named-paragraph">Create an iFiction file</span><span class="named-paragraph-number">6.3</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">INSTRUCTION_REQ:</span><span class="plain-syntax"> </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">INTERPRETER_REQ:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP6_8" class="named-paragraph-link"><span class="named-paragraph">Create an in-browser interpreter</span><span class="named-paragraph-number">6.8</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">RELEASE_FILE_REQ:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP6_6" class="named-paragraph-link"><span class="named-paragraph">Release a file into the release folder</span><span class="named-paragraph-number">6.6</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">RELEASE_SOURCE_REQ:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP6_7" class="named-paragraph-link"><span class="named-paragraph">Release source text as HTML into the release folder</span><span class="named-paragraph-number">6.7</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">SOLUTION_REQ:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP6_1" class="named-paragraph-link"><span class="named-paragraph">Create a Solution::walkthrough file</span><span class="named-paragraph-number">6.1</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">SOURCE_REQ:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP6_2" class="named-paragraph-link"><span class="named-paragraph">Create a plain text source file</span><span class="named-paragraph-number">6.2</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">WEBSITE_REQ:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP6_9" class="named-paragraph-link"><span class="named-paragraph">Create a website</span><span class="named-paragraph-number">6.9</span></a></span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6_1" class="paragraph-anchor"></a><b>&#167;6.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create a Solution::walkthrough file</span><span class="named-paragraph-number">6.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">Skein_filename</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">project_folder</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Skein.skein"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">solution_filename</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">release_folder</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"solution.txt"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-sd.html#SP3" class="function-link"><span class="function-syntax">Solution::walkthrough</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">Skein_filename</span><span class="plain-syntax">, </span><span class="identifier-syntax">solution_filename</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_2" class="paragraph-anchor"></a><b>&#167;6.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create a plain text source file</span><span class="named-paragraph-number">6.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">pathname</span><span class="plain-syntax"> *</span><span class="identifier-syntax">Source</span><span class="plain-syntax"> = </span><a href="../foundation/3-pth.html#SP4" class="function-link"><span class="function-syntax">Pathnames::down</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">project_folder</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Source"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">source_text_filename</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">Source</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"story.ni"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">write_to</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">release_folder</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"source.txt"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/6-bf.html#SP9" class="function-link"><span class="function-syntax">BinaryFiles::copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">source_text_filename</span><span class="plain-syntax">, </span><span class="identifier-syntax">write_to</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_3" class="paragraph-anchor"></a><b>&#167;6.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create an iFiction file</span><span class="named-paragraph-number">6.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">iFiction_filename</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">project_folder</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Metadata.iFiction"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">write_to</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">release_folder</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"iFiction.xml"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/6-bf.html#SP9" class="function-link"><span class="function-syntax">BinaryFiles::copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">iFiction_filename</span><span class="plain-syntax">, </span><span class="identifier-syntax">write_to</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_4" class="paragraph-anchor"></a><b>&#167;6.4. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Copy a file into the release folder</span><span class="named-paragraph-number">6.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">pathname</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax"> = </span><span class="identifier-syntax">release_folder</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-sm.html#SP22" class="function-link"><span class="function-syntax">Str::eq_wide_string</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details3</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"--"</span><span class="plain-syntax">) == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">P</span><span class="plain-syntax"> = </span><a href="../foundation/3-pth.html#SP4" class="function-link"><span class="function-syntax">Pathnames::down</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details3</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">write_to</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP3" class="function-link"><span class="function-syntax">Filenames::from_text</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">size</span><span class="plain-syntax"> = </span><a href="../foundation/6-bf.html#SP9" class="function-link"><span class="function-syntax">BinaryFiles::copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="identifier-syntax">write_to</span><span class="plain-syntax">, </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">outcome_data</span><span class="plain-syntax"> = </span><span class="identifier-syntax">size</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">size</span><span class="plain-syntax"> == -1)</span>
<span class="plain-syntax">        </span><a href="1-be.html#SP3" class="function-link"><span class="function-syntax">BlorbErrors::errorf_1S</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"You asked to release along with a file called '%S', which ought "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"to be in the Materials folder for the project. But I can't find "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"it there."</span><span class="plain-syntax">, </span><a href="../foundation/3-fln.html#SP7" class="function-link"><span class="function-syntax">Filenames::get_leafname</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">from</span><span class="plain-syntax">));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_5" class="paragraph-anchor"></a><b>&#167;6.5. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Copy a base64-encoded file across</span><span class="named-paragraph-number">6.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="3-bs6.html#SP2" class="function-link"><span class="function-syntax">Base64::encode</span></a><span class="plain-syntax">(</span><a href="../foundation/3-fln.html#SP3" class="function-link"><span class="function-syntax">Filenames::from_text</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details1</span><span class="plain-syntax">), </span><a href="../foundation/3-fln.html#SP3" class="function-link"><span class="function-syntax">Filenames::from_text</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details2</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP3" class="function-link"><span class="function-syntax">Placeholders::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"BASESIXTYFOURTOP"</span><span class="plain-syntax">), </span><a href="3-plc.html#SP3" class="function-link"><span class="function-syntax">Placeholders::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"BASESIXTYFOURTAIL"</span><span class="plain-syntax">));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_6" class="paragraph-anchor"></a><b>&#167;6.6. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Release a file into the release folder</span><span class="named-paragraph-number">6.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="3-rls.html#SP9" class="function-link"><span class="function-syntax">Requests::release_file_into_website</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details1</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details2</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_7" class="paragraph-anchor"></a><b>&#167;6.7. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Release source text as HTML into the release folder</span><span class="named-paragraph-number">6.7</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::set_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"SOURCEPREFIX"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"source"</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::set_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"SOURCELOCATION"</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details1</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::set_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"TEMPLATE"</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details3</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">HTML_template</span><span class="plain-syntax"> = </span><a href="3-tmp.html#SP6" class="function-link"><span class="function-syntax">Templates::find_file_in_specific_template</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details3</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">HTML_template</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><a href="1-be.html#SP3" class="function-link"><span class="function-syntax">BlorbErrors::error_1S</span></a><span class="plain-syntax">(</span><span class="string-syntax">"can't find HTML template file"</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">verbose_mode</span><span class="plain-syntax">) </span><span class="identifier-syntax">PRINT</span><span class="plain-syntax">(</span><span class="string-syntax">"! Web page %f from template %s\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">HTML_template</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details3</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-wm.html#SP11" class="function-link"><span class="function-syntax">Websites::web_copy_source</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">HTML_template</span><span class="plain-syntax">, </span><span class="identifier-syntax">release_folder</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_8" class="paragraph-anchor"></a><b>&#167;6.8. </b>Interpreters are copied, not made. They're really just like website
templates, except that they have a manifest file instead of an extras file,
and that they're copied into an <span class="extract"><span class="extract-syntax">interpreter</span></span> subfolder of the release folder,
which is assumed already to exist. (It isn't copied because folder creation
is tiresome to do in a cross-platform way, since Windows doesn't follow POSIX.
The necessary code exists in Inform already, so we'll do it there.)
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create an in-browser interpreter</span><span class="named-paragraph-number">6.8</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::set_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"INTERPRETER"</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details1</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax"> = </span><a href="3-plc.html#SP3" class="function-link"><span class="function-syntax">Placeholders::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"INTERPRETER"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><a href="3-tmp.html#SP6" class="function-link"><span class="function-syntax">Templates::find_file_in_specific_template</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"(manifest).txt"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">from</span><span class="plain-syntax">) { </span><span class="comment-syntax"> i.e., if the "(manifest).txt" file exists</span>
<span class="plain-syntax">        </span><a href="../foundation/4-tf.html#SP5" class="function-link"><span class="function-syntax">TextFiles::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">, </span><span class="string-syntax">"can't open (manifest) file"</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">, </span><a href="3-rls.html#SP8" class="function-link"><span class="function-syntax">Requests::read_requested_ifile</span></a><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_9" class="paragraph-anchor"></a><b>&#167;6.9. </b>We copy the CSS file, if we need one; make the home page; and make any
other pages demanded by public released material. After that, it's up to
the template to add more if it wants to.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create a website</span><span class="named-paragraph-number">6.9</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::set_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"TEMPLATE"</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details1</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax"> = </span><a href="3-plc.html#SP3" class="function-link"><span class="function-syntax">Placeholders::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"TEMPLATE"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">use_css_code_styles</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><a href="3-tmp.html#SP6" class="function-link"><span class="function-syntax">Templates::find_file_in_specific_template</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"style.css"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">from</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CSS_filename</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">release_folder</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"style.css"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="../foundation/6-bf.html#SP9" class="function-link"><span class="function-syntax">BinaryFiles::copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="identifier-syntax">CSS_filename</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><a href="3-rls.html#SP9" class="function-link"><span class="function-syntax">Requests::release_file_into_website</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"index.html"</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">, </span><span class="reserved-syntax">request</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">private</span><span class="plain-syntax"> == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">what_is_requested</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">INTERPRETER_REQ:</span>
<span class="plain-syntax">                    </span><a href="3-rls.html#SP9" class="function-link"><span class="function-syntax">Requests::release_file_into_website</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"play.html"</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">SOURCE_REQ:</span>
<span class="plain-syntax">                    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::set_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"SOURCEPREFIX"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"source"</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">pathname</span><span class="plain-syntax"> *</span><span class="identifier-syntax">Source</span><span class="plain-syntax"> = </span><a href="../foundation/3-pth.html#SP4" class="function-link"><span class="function-syntax">Pathnames::down</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">project_folder</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Source"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">story</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">Source</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"story.ni"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">source_text</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">source_text</span><span class="plain-syntax">, </span><span class="string-syntax">"%f"</span><span class="plain-syntax">, </span><span class="identifier-syntax">story</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::set_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"SOURCELOCATION"</span><span class="plain-syntax">, </span><span class="identifier-syntax">source_text</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">source_text</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><a href="3-rls.html#SP9" class="function-link"><span class="function-syntax">Requests::release_file_into_website</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"source.html"</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP6_9_1" class="named-paragraph-link"><span class="named-paragraph">Add further material as requested by the template</span><span class="named-paragraph-number">6.9.1</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP6">&#167;6</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP6_9_1" class="paragraph-anchor"></a><b>&#167;6.9.1. </b>Most templates do not request extra files, but they have the option by
including a manifest called "(extras).txt":
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Add further material as requested by the template</span><span class="named-paragraph-number">6.9.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><a href="3-tmp.html#SP6" class="function-link"><span class="function-syntax">Templates::find_file_in_specific_template</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"(extras).txt"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">from</span><span class="plain-syntax">) { </span><span class="comment-syntax"> i.e., if the "(extras).txt" file exists</span>
<span class="plain-syntax">        </span><a href="../foundation/4-tf.html#SP5" class="function-link"><span class="function-syntax">TextFiles::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">, </span><span class="string-syntax">"can't open (extras) file"</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">, </span><a href="3-rls.html#SP7" class="function-link"><span class="function-syntax">Requests::read_requested_file</span></a><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP6_9">&#167;6.9</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. The Extras file for a website template.</b>When parsing "(extras).txt", <span class="extract"><span class="extract-syntax">Requests::read_requested_file</span></span> is called for each line.
We trim white space and expect the result to be a filename of something
within the template.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Requests::read_requested_file</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">Requests::read_requested_file</span></span>:<br/><a href="3-rls.html#SP6_9_1">&#167;6.9.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="reserved-syntax">filename</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_file_position</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tfp</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">state</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="../foundation/4-sm.html#SP24" class="function-link"><span class="function-syntax">Str::trim_white_space</span></a><span class="plain-syntax">(</span><span class="reserved-syntax">filename</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-sm.html#SP8" class="function-link"><span class="function-syntax">Str::len</span></a><span class="plain-syntax">(</span><span class="reserved-syntax">filename</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="3-rls.html#SP9" class="function-link"><span class="function-syntax">Requests::release_file_into_website</span></a><span class="plain-syntax">(</span><span class="reserved-syntax">filename</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP3" class="function-link"><span class="function-syntax">Placeholders::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"TEMPLATE"</span><span class="plain-syntax">), </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. The Manifest file for an interpreter.</b>When parsing "(manifest).txt", we do almost the same thing. Like a website
template, an interpreter is stored in a single folder, and the manifest can
list files which need to be copied into the Release in order to piece together
a working copy of the interpreter.
</p>

<p class="commentary">However, this is more expressive than the "(extras).txt" file because it
also has the ability to set placeholders in Inblorb. We use this mechanism
because it allows each interpreter to provide some metadata about its own
identity and exactly how it wants to be interfaced with the website which
Inblorb will generate. This isn't the place to document what those metadata
placeholders are and what they mean, since (except for a consistency check
below) Inblorb doesn't know anything about them &mdash; it's the Standard
website template which they need to match up to. Anyway, the best way
to get an idea of this is to read the manifest file for the default,
Parchment, interpreter.
</p>

<p class="commentary">Placeholders are set thus:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    [</span><span class="identifier-syntax">INTERPRETERVERSION</span><span class="plain-syntax">]</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Parchment</span><span class="plain-syntax"> </span><span class="reserved-syntax">for</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inform</span><span class="plain-syntax"> </span><span class="constant-syntax">7</span>
<span class="plain-syntax">    []</span>
</pre>
<p class="commentary">where the opening line names the placeholder, then one or more lines give
the contents, and the box line ends the definition.
</p>

<p class="commentary">We're in the mode if <span class="extract"><span class="extract-syntax">current_placeholder</span></span> is a non-empty text, and
if so, then it's the name of the one being set. Thus the code to handle
the opening and closing lines can be identical.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">current_placeholder</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">cp_written</span><span class="plain-syntax"> = </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Requests::read_requested_ifile</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">Requests::read_requested_ifile</span></span>:<br/><a href="3-rls.html#SP6_8">&#167;6.8</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">manifestline</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_file_position</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tfp</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">state</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">cp_written</span><span class="plain-syntax"> == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">) { </span><span class="identifier-syntax">cp_written</span><span class="plain-syntax"> = </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">; </span><span class="identifier-syntax">current_placeholder</span><span class="plain-syntax"> = </span><a href="../foundation/4-sm.html#SP2" class="function-link"><span class="function-syntax">Str::new</span></a><span class="plain-syntax">(); }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">match_results</span><span class="plain-syntax"> </span><span class="identifier-syntax">mr</span><span class="plain-syntax"> = </span><a href="../foundation/4-pm.html#SP9" class="function-link"><span class="function-syntax">Regexp::create_mr</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-pm.html#SP10" class="function-link"><span class="function-syntax">Regexp::match</span></a><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">manifestline</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *(%c*?) *"</span><span class="plain-syntax">)) </span><a href="../foundation/4-sm.html#SP17" class="function-link"><span class="function-syntax">Str::copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">manifestline</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="element-syntax">exp</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-pm.html#SP10" class="function-link"><span class="function-syntax">Regexp::match</span></a><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">manifestline</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"%[(%c*)%]"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="../foundation/4-sm.html#SP17" class="function-link"><span class="function-syntax">Str::copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">current_placeholder</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="element-syntax">exp</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-sm.html#SP8" class="function-link"><span class="function-syntax">Str::len</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">current_placeholder</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP8_1" class="named-paragraph-link"><span class="named-paragraph">We're outside placeholder mode, so it's a comment or a manifested filename</span><span class="named-paragraph-number">8.1</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP8_2" class="named-paragraph-link"><span class="named-paragraph">We're inside placeholder mode, so it's content to be spooled into the named placeholder</span><span class="named-paragraph-number">8.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="../foundation/4-pm.html#SP9" class="function-link"><span class="function-syntax">Regexp::dispose_of</span></a><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8_1" class="paragraph-anchor"></a><b>&#167;8.1. </b>Outside of placeholders, blank lines and lines introduced by the comment
character <span class="extract"><span class="extract-syntax">!</span></span> are skipped.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">We're outside placeholder mode, so it's a comment or a manifested filename</span><span class="named-paragraph-number">8.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><a href="../foundation/4-sm.html#SP8" class="function-link"><span class="function-syntax">Str::len</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">manifestline</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) || (</span><a href="../foundation/4-sm.html#SP13" class="function-link"><span class="function-syntax">Str::get_first_char</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">manifestline</span><span class="plain-syntax">) == </span><span class="character-syntax">'!'</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="3-rls.html#SP9" class="function-link"><span class="function-syntax">Requests::release_file_into_website</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">manifestline</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP3" class="function-link"><span class="function-syntax">Placeholders::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"INTERPRETER"</span><span class="plain-syntax">), </span><span class="identifier-syntax">I</span><span class="string-syntax">"interpreter"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_2" class="paragraph-anchor"></a><b>&#167;8.2. </b>Line breaks are included between lines, though not at the end of the final
line, so that a one-line definition like the example above contains no line
break. White space is stripped out at the left and right hand edges of
each line.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">We're inside placeholder mode, so it's content to be spooled into the named placeholder</span><span class="named-paragraph-number">8.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-sm.html#SP19" class="function-link"><span class="function-syntax">Str::eq</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">current_placeholder</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"INTERPRETERVM"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP8_2_1" class="named-paragraph-link"><span class="named-paragraph">Check the value being given against the actual VM we're blorbing up</span><span class="named-paragraph-number">8.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-plc.html#SP3" class="function-link"><span class="function-syntax">Placeholders::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">current_placeholder</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">current_placeholder</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">current_placeholder</span><span class="plain-syntax">, </span><span class="identifier-syntax">manifestline</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_2_1" class="paragraph-anchor"></a><b>&#167;8.2.1. </b>Perhaps it's clumsy to do it here, but at some point Inblorb needs to
make sure we aren't trying to release a Z-machine game along with a
Glulx interpreter, or vice versa. The manifest file for the interpreter
is required to declare which virtual machines it implements, by giving a
value of the placeholder <span class="extract"><span class="extract-syntax">INTERPRETERVM</span></span>. This declares whether the interpreter
can handle blorbed Z-machine files (<span class="extract"><span class="extract-syntax">z</span></span>), blorbed Glulx files (<span class="extract"><span class="extract-syntax">g</span></span>) or both
(<span class="extract"><span class="extract-syntax">zg</span></span> or <span class="extract"><span class="extract-syntax">gz</span></span>). No other values are legal; note lower case. Inblorb then
checks this against its own placeholder <span class="extract"><span class="extract-syntax">INTERPRETERVMIS</span></span>, which stores
what the actual format of the blorb being released is.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Check the value being given against the actual VM we're blorbing up</span><span class="named-paragraph-number">8.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vm_used</span><span class="plain-syntax"> = </span><a href="3-plc.html#SP3" class="function-link"><span class="function-syntax">Placeholders::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"INTERPRETERVMIS"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">capable</span><span class="plain-syntax"> = </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_THROUGH_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">manifestline</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-sm.html#SP13" class="function-link"><span class="function-syntax">Str::get</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">) == </span><a href="../foundation/4-sm.html#SP13" class="function-link"><span class="function-syntax">Str::get_first_char</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">vm_used</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">capable</span><span class="plain-syntax"> = </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">capable</span><span class="plain-syntax"> == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">format</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"Z-machine"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-sm.html#SP13" class="function-link"><span class="function-syntax">Str::get_first_char</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">vm_used</span><span class="plain-syntax">) == </span><span class="character-syntax">'g'</span><span class="plain-syntax">) </span><span class="identifier-syntax">format</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"Glulx"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><a href="1-be.html#SP3" class="function-link"><span class="function-syntax">BlorbErrors::errorf_2S</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"You asked to release along with a copy of the '%S' in-browser "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"interpreter, but this can't handle story files which use the "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"%S story file format. (The format can be changed on Inform's "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"Settings panel for a project.)"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="3-plc.html#SP3" class="function-link"><span class="function-syntax">Placeholders::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"INTERPRETER"</span><span class="plain-syntax">), </span><span class="identifier-syntax">format</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP8_2">&#167;8.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. </b>There are really three cases when we release something from a website
template. We can copy it verbatim as a binary file, we can expand placeholders
but otherwise copy as a single item, or we can use it to make a mass
generation of source pages.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Requests::release_file_into_website</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">Requests::release_file_into_website</span></span>:<br/><a href="3-rls.html#SP6_6">&#167;6.6</a>, <a href="3-rls.html#SP6_9">&#167;6.9</a>, <a href="3-rls.html#SP7">&#167;7</a>, <a href="3-rls.html#SP8_1">&#167;8.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">name</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sub</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">pathname</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax"> = </span><span class="identifier-syntax">release_folder</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">sub</span><span class="plain-syntax">) </span><span class="identifier-syntax">P</span><span class="plain-syntax"> = </span><a href="../foundation/3-pth.html#SP4" class="function-link"><span class="function-syntax">Pathnames::down</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">sub</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">write_to</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><a href="3-tmp.html#SP6" class="function-link"><span class="function-syntax">Templates::find_file_in_specific_template</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">from</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><a href="1-be.html#SP3" class="function-link"><span class="function-syntax">BlorbErrors::error_1S</span></a><span class="plain-syntax">(</span><span class="string-syntax">"unable to find file in website template"</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/3-fln.html#SP9" class="function-link"><span class="function-syntax">Filenames::guess_format</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">write_to</span><span class="plain-syntax">) == </span><span class="constant-syntax">FORMAT_PERHAPS_HTML</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP9_1" class="named-paragraph-link"><span class="named-paragraph">Release an HTML page from the template into the website</span><span class="named-paragraph-number">9.1</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP9_2" class="named-paragraph-link"><span class="named-paragraph">Release a binary file from the template into the website</span><span class="named-paragraph-number">9.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP9_1" class="paragraph-anchor"></a><b>&#167;9.1. </b>"Source.html" is a special case, as it expands into a whole suite of
pages automagically. Otherwise we work out the filenames and then hand over
to the experts.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Release an HTML page from the template into the website</span><span class="named-paragraph-number">9.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::set_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"TEMPLATE"</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">verbose_mode</span><span class="plain-syntax">) </span><span class="identifier-syntax">PRINT</span><span class="plain-syntax">(</span><span class="string-syntax">"! Web page %S from template %S\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-sm.html#SP22" class="function-link"><span class="function-syntax">Str::eq_wide_string</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">name</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"source.html"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="3-wm.html#SP11" class="function-link"><span class="function-syntax">Websites::web_copy_source</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="identifier-syntax">release_folder</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><a href="3-wm.html#SP9" class="function-link"><span class="function-syntax">Websites::web_copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="identifier-syntax">write_to</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP9">&#167;9</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP9_2" class="paragraph-anchor"></a><b>&#167;9.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Release a binary file from the template into the website</span><span class="named-paragraph-number">9.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">verbose_mode</span><span class="plain-syntax">) </span><span class="identifier-syntax">PRINT</span><span class="plain-syntax">(</span><span class="string-syntax">"! Binary file %S from template %S\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="../foundation/6-bf.html#SP9" class="function-link"><span class="function-syntax">BinaryFiles::copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="identifier-syntax">write_to</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP9">&#167;9</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. </b>The home page will need links to any public released resources, and this
is where those are added (to the other links already present, that is).
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Requests::add_links_to_requested_resources</span><button class="popup" onclick="togglePopup('usagePopup10')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup10">Usage of <span class="code-font"><span class="function-syntax">Requests::add_links_to_requested_resources</span></span>:<br/>Links and Auxiliary Files - <a href="3-laaf.html#SP4">&#167;4</a></span></button><span class="plain-syntax">(</span><span class="constant-syntax">OUTPUT_STREAM</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">, </span><span class="reserved-syntax">request</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">private</span><span class="plain-syntax"> == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">what_is_requested</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">WEBSITE_REQ:</span><span class="plain-syntax"> </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">INTERPRETER_REQ:</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><a href="3-laaf.html#SP6" class="function-link"><span class="function-syntax">Links::download_link</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Play In-Browser"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"play.html"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"link"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;/li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">SOURCE_REQ:</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><a href="3-laaf.html#SP6" class="function-link"><span class="function-syntax">Links::download_link</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Source Text"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"source.html"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"link"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;/li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">SOLUTION_REQ:</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><a href="3-laaf.html#SP6" class="function-link"><span class="function-syntax">Links::download_link</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Solution"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"solution.txt"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"link"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;/li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">IFICTION_REQ:</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><a href="3-laaf.html#SP6" class="function-link"><span class="function-syntax">Links::download_link</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Library Card"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"iFiction.xml"</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"link"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;/li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. Blorb relocation.</b>This is a little dodge used to make the process of releasing games in
Inform 7 more seamless: see the manual for an explanation.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Requests::declare_where_blorb_should_be_copied</span><button class="popup" onclick="togglePopup('usagePopup11')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup11">Usage of <span class="code-font"><span class="function-syntax">Requests::declare_where_blorb_should_be_copied</span></span>:<br/><a href="3-rls.html#SP6">&#167;6</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">pathname</span><span class="plain-syntax"> *</span><span class="identifier-syntax">path</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">leaf</span><span class="plain-syntax"> = </span><a href="3-plc.html#SP3" class="function-link"><span class="function-syntax">Placeholders::read</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"STORYFILE"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">leaf</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">leaf</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"Story"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to</span><span class="plain-syntax"> = </span><a href="../foundation/3-fln.html#SP2" class="function-link"><span class="function-syntax">Filenames::in</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">path</span><span class="plain-syntax">, </span><span class="identifier-syntax">leaf</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PRINT</span><span class="plain-syntax">(</span><span class="string-syntax">"Copy blorb to: [[%f]]\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">to</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. Reporting the release.</b>Inform normally asks Inblorb to generate an HTML page reporting what it has
done, and if things have gone well then this typically contains a list of
what has been released. (That's easy for us to produce, since we just have to
look through the requests.) Rather than attempt to write to the file here,
we copy the necessary HTML into the placeholder <span class="extract"><span class="extract-syntax">ph</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Requests::report_requested_material</span><button class="popup" onclick="togglePopup('usagePopup12')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup12">Usage of <span class="code-font"><span class="function-syntax">Requests::report_requested_material</span></span>:<br/>Main - <a href="1-mn.html#SP7_1">&#167;7.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ph</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">release_folder</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax">; </span><span class="comment-syntax"> this should never happen</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">launch_website</span><span class="plain-syntax"> = </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">launch_play</span><span class="plain-syntax"> = </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;ul&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP12_1" class="named-paragraph-link"><span class="named-paragraph">Itemise the blorb file, possibly mentioning pictures and sounds</span><span class="named-paragraph-number">12.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP12_2" class="named-paragraph-link"><span class="named-paragraph">Itemise the website, mentioning how many pages it has</span><span class="named-paragraph-number">12.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP12_3" class="named-paragraph-link"><span class="named-paragraph">Itemise the interpreter</span><span class="named-paragraph-number">12.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP12_4" class="named-paragraph-link"><span class="named-paragraph">Itemise the library card</span><span class="named-paragraph-number">12.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP12_5" class="named-paragraph-link"><span class="named-paragraph">Itemise the solution file</span><span class="named-paragraph-number">12.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP12_6" class="named-paragraph-link"><span class="named-paragraph">Itemise the source text</span><span class="named-paragraph-number">12.6</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP12_7" class="named-paragraph-link"><span class="named-paragraph">Itemise auxiliary files in a sub-list</span><span class="named-paragraph-number">12.7</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;/ul&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">launch_website</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">launch_play</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP12_8" class="named-paragraph-link"><span class="named-paragraph">Give a centred line of links to the main web pages produced</span><span class="named-paragraph-number">12.8</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP12_9" class="named-paragraph-link"><span class="named-paragraph">Add in links to release instructions from Inform source text</span><span class="named-paragraph-number">12.9</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-rls.html#SP12_10" class="named-paragraph-link"><span class="named-paragraph">Add in advertisements for features Inform would like to offer</span><span class="named-paragraph-number">12.10</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12_1" class="paragraph-anchor"></a><b>&#167;12.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Itemise the blorb file, possibly mentioning pictures and sounds</span><span class="named-paragraph-number">12.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">no_pictures_included</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">1</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">no_sounds_included</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">no_data_files_included</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="../foundation/4-sm.html#SP27" class="function-link"><span class="function-syntax">Str::literal</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">U</span><span class="string-syntax">"&lt;li&gt;The blorb file &lt;b&gt;[STORYFILE]&lt;/b&gt; ([BLORBFILESIZE]K in size, "</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">U</span><span class="string-syntax">"including [BLORBFILEPICTURES] figures(s), [BLORBFILESOUNDS] "</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">U</span><span class="string-syntax">"sound(s) and [BLORBFILEDATAFILES] data files(s))&lt;/li&gt;"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;li&gt;The blorb file &lt;b&gt;[STORYFILE]&lt;/b&gt; ([BLORBFILESIZE]K in size)&lt;/li&gt;"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP12">&#167;12</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP12_2" class="paragraph-anchor"></a><b>&#167;12.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Itemise the website, mentioning how many pages it has</span><span class="named-paragraph-number">12.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-rls.html#SP13" class="function-link"><span class="function-syntax">Requests::count_requests_of_type</span></a><span class="plain-syntax">(</span><span class="constant-syntax">WEBSITE_REQ</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;li&gt;A website (generated from the [TEMPLATE] template) of "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcount</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcount</span><span class="plain-syntax">, </span><span class="string-syntax">"%d page%s"</span><span class="plain-syntax">, </span><span class="identifier-syntax">HTML_pages_created</span><span class="plain-syntax">, (</span><span class="identifier-syntax">HTML_pages_created</span><span class="plain-syntax">!=1)?</span><span class="string-syntax">"s"</span><span class="plain-syntax">:</span><span class="string-syntax">""</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">pcount</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;/li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">launch_website</span><span class="plain-syntax"> = </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcount</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP12">&#167;12</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP12_3" class="paragraph-anchor"></a><b>&#167;12.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Itemise the interpreter</span><span class="named-paragraph-number">12.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-rls.html#SP13" class="function-link"><span class="function-syntax">Requests::count_requests_of_type</span></a><span class="plain-syntax">(</span><span class="constant-syntax">INTERPRETER_REQ</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">launch_play</span><span class="plain-syntax"> = </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;li&gt;A play-in-browser page (generated from the [INTERPRETER] interpreter)&lt;/li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP12">&#167;12</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP12_4" class="paragraph-anchor"></a><b>&#167;12.4. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Itemise the library card</span><span class="named-paragraph-number">12.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-rls.html#SP13" class="function-link"><span class="function-syntax">Requests::count_requests_of_type</span></a><span class="plain-syntax">(</span><span class="constant-syntax">IFICTION_REQ</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;li&gt;The library card (stored as an iFiction record)&lt;/li&gt;"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP12">&#167;12</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP12_5" class="paragraph-anchor"></a><b>&#167;12.5. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Itemise the solution file</span><span class="named-paragraph-number">12.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-rls.html#SP13" class="function-link"><span class="function-syntax">Requests::count_requests_of_type</span></a><span class="plain-syntax">(</span><span class="constant-syntax">SOLUTION_REQ</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;li&gt;A solution file&lt;/li&gt;"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP12">&#167;12</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP12_6" class="paragraph-anchor"></a><b>&#167;12.6. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Itemise the source text</span><span class="named-paragraph-number">12.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-rls.html#SP13" class="function-link"><span class="function-syntax">Requests::count_requests_of_type</span></a><span class="plain-syntax">(</span><span class="constant-syntax">SOURCE_REQ</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">source_HTML_pages_created</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;li&gt;The source text (as plain text and as "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcount</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcount</span><span class="plain-syntax">, </span><span class="string-syntax">"%d web page%s"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">source_HTML_pages_created</span><span class="plain-syntax">, (</span><span class="identifier-syntax">source_HTML_pages_created</span><span class="plain-syntax">!=1)?</span><span class="string-syntax">"s"</span><span class="plain-syntax">:</span><span class="string-syntax">""</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">pcount</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">")&lt;/li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pcount</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-rls.html#SP13" class="function-link"><span class="function-syntax">Requests::count_requests_of_type</span></a><span class="plain-syntax">(</span><span class="constant-syntax">RELEASE_SOURCE_REQ</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;li&gt;The source text (as part of the website)&lt;/li&gt;"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP12">&#167;12</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP12_7" class="paragraph-anchor"></a><b>&#167;12.7. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Itemise auxiliary files in a sub-list</span><span class="named-paragraph-number">12.7</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="3-rls.html#SP13" class="function-link"><span class="function-syntax">Requests::count_requests_of_type</span></a><span class="plain-syntax">(</span><span class="constant-syntax">COPY_REQ</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;li&gt;The following additional file(s):&lt;ul&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">, </span><span class="reserved-syntax">request</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">what_is_requested</span><span class="plain-syntax"> == </span><span class="constant-syntax">COPY_REQ</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">leafname</span><span class="plain-syntax"> = </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">leafname</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">outcome_data</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">4096</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">filesize</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">filesize</span><span class="plain-syntax">, </span><span class="string-syntax">" (%dK)"</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">outcome_data</span><span class="plain-syntax">/1024);</span>
<span class="plain-syntax">                    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">filesize</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">filesize</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">outcome_data</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">filesize</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">filesize</span><span class="plain-syntax">, </span><span class="string-syntax">" (%d byte%s)"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                        </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">outcome_data</span><span class="plain-syntax">, (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">outcome_data</span><span class="plain-syntax">!=1)?</span><span class="string-syntax">"s"</span><span class="plain-syntax">:</span><span class="string-syntax">""</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">filesize</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">filesize</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                }</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../foundation/4-sm.html#SP22" class="function-link"><span class="function-syntax">Str::eq_wide_string</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details3</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"--"</span><span class="plain-syntax">) == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">" to subfolder "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details3</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                }</span>
<span class="plain-syntax">                </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;/li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;/ul&gt;&lt;/li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP12">&#167;12</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP12_8" class="paragraph-anchor"></a><b>&#167;12.8. </b>These two links are handled by means of LAUNCH icons which, if clicked,
open the relevant pages not in the Inform application but using an external
web browser (e.g., Safari on most Mac OS X installations). We can only
achieve this effect using a Javascript function provided by the Inform
application, called <span class="extract"><span class="extract-syntax">openUrl</span></span>.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Give a centred line of links to the main web pages produced</span><span class="named-paragraph-number">12.8</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;p&gt;&lt;center&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">launch_website</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="../foundation/4-sm.html#SP27" class="function-link"><span class="function-syntax">Str::literal</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">U</span><span class="string-syntax">"&lt;a href=\"javascript:window.Project."</span>
<span class="plain-syntax">                </span><span class="string-syntax">"openUrl('file:</span><span class="comment-syntax">[**MATERIALSFOLDERPATHOPEN]/Release/index.html')\"&gt;"</span>
<span class="string-syntax">                "</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">img</span><span class="plain-syntax"> </span><span class="identifier-syntax">src</span><span class="plain-syntax">=</span><span class="character-syntax">'inform:/outcome_images/browse.png'</span><span class="plain-syntax"> </span><span class="identifier-syntax">border</span><span class="plain-syntax">=0&gt;</span><span class="function-syntax">&lt;/a&gt;</span><span class="plain-syntax"> </span><span class="identifier-syntax">home</span><span class="plain-syntax"> </span><span class="identifier-syntax">page</span><span class="string-syntax">"));</span>
<span class="string-syntax">    }</span>
<span class="string-syntax">    if ((launch_website) &amp;&amp; (launch_play))</span>
<span class="string-syntax">        Placeholders::append_to(ph, I"</span><span class="plain-syntax"> : </span><span class="string-syntax">");</span>
<span class="string-syntax">    if (launch_play)</span>
<span class="string-syntax">        Placeholders::append_to(ph,</span>
<span class="string-syntax">            Str::literal(U"</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">href</span><span class="plain-syntax">=\</span><span class="string-syntax">"javascript:window.Project."</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">U</span><span class="string-syntax">"openUrl('file:</span><span class="comment-syntax">[**MATERIALSFOLDERPATHOPEN]/Release/play.html')\"&gt;"</span>
<span class="string-syntax">                U"</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">img</span><span class="plain-syntax"> </span><span class="identifier-syntax">src</span><span class="plain-syntax">=</span><span class="character-syntax">'inform:/outcome_images/browse.png'</span><span class="plain-syntax"> </span><span class="identifier-syntax">border</span><span class="plain-syntax">=0&gt;</span><span class="function-syntax">&lt;/a&gt;</span><span class="plain-syntax"> </span><span class="identifier-syntax">play</span><span class="plain-syntax">-</span><span class="identifier-syntax">in</span><span class="plain-syntax">-</span><span class="identifier-syntax">browser</span><span class="plain-syntax"> </span><span class="identifier-syntax">page</span><span class="string-syntax">"));</span>
<span class="string-syntax">    Placeholders::append_to(ph, I"</span><span class="function-syntax">&lt;/center&gt;&lt;/p&gt;</span><span class="string-syntax">");</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP12">&#167;12</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP12_9" class="paragraph-anchor"></a><b>&#167;12.9. </b>Since Inblorb has no knowledge of what the Inform source text producing
this blorb was, it can't finish the status report from its own knowledge &mdash;
it must rely on details supplied to it by Inform via blurb commands. First,
Inform gives it source-text links for any "Release along with..." sentences,
which have by now become <span class="extract"><span class="extract-syntax">INSTRUCTION_REQ</span></span> requests:
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Add in links to release instructions from Inform source text</span><span class="named-paragraph-number">12.9</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">count</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">, </span><span class="reserved-syntax">request</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">what_is_requested</span><span class="plain-syntax"> == </span><span class="constant-syntax">INSTRUCTION_REQ</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">count</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;p&gt;The source text gives release instructions "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">                </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">" and "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">" here"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">count</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">count</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">".&lt;/p&gt;"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP12">&#167;12</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP12_10" class="paragraph-anchor"></a><b>&#167;12.10. </b>And secondly, Inform gives it adverts for other fancy services on offer,
complete with links to the Inform documentation (which, again, Inblorb
doesn't itself know about); and these have by now become <span class="extract"><span class="extract-syntax">ALTERNATIVE_REQ</span></span>
requests.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Add in advertisements for features Inform would like to offer</span><span class="named-paragraph-number">12.10</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">count</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">, </span><span class="reserved-syntax">request</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">what_is_requested</span><span class="plain-syntax"> == </span><span class="constant-syntax">ALTERNATIVE_REQ</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">count</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;p&gt;Here are some other possibilities you might want to consider:&lt;p&gt;&lt;ul&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">details1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;/li&gt;"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">count</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">count</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><a href="3-plc.html#SP5" class="function-link"><span class="function-syntax">Placeholders::append_to</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ph</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"&lt;/ul&gt;&lt;/p&gt;"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-rls.html#SP12">&#167;12</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP13" class="paragraph-anchor"></a><b>&#167;13. </b>A convenient way to see if we've received requests of any given type:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Requests::count_requests_of_type</span><button class="popup" onclick="togglePopup('usagePopup13')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup13">Usage of <span class="code-font"><span class="function-syntax">Requests::count_requests_of_type</span></span>:<br/><a href="3-rls.html#SP12_2">&#167;12.2</a>, <a href="3-rls.html#SP12_3">&#167;12.3</a>, <a href="3-rls.html#SP12_4">&#167;12.4</a>, <a href="3-rls.html#SP12_5">&#167;12.5</a>, <a href="3-rls.html#SP12_6">&#167;12.6</a>, <a href="3-rls.html#SP12_7">&#167;12.7</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">t</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">count</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">, </span><span class="reserved-syntax">request</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">what_is_requested</span><span class="plain-syntax"> == </span><span class="identifier-syntax">t</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">count</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">count</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="2-bw.html">&#10094;</a></li><li class="progresschapter"><a href="M-ui.html">M</a></li><li class="progresschapter"><a href="1-bsc.html">1</a></li><li class="progresschapter"><a href="2-bw.html">2</a></li><li class="progresscurrentchapter">3</li><li class="progresscurrent">rls</li><li class="progresssection"><a href="3-sd.html">sd</a></li><li class="progresssection"><a href="3-laaf.html">laaf</a></li><li class="progresssection"><a href="3-plc.html">plc</a></li><li class="progresssection"><a href="3-tmp.html">tmp</a></li><li class="progresssection"><a href="3-wm.html">wm</a></li><li class="progresssection"><a href="3-bs6.html">bs6</a></li><li class="progressnext"><a href="3-sd.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

